package day9;

import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

public class Demo {
    @Test
    public void test() throws FileNotFoundException, IOException {
        List<String> list = new ArrayList<>();
        //文件复制
        Files.copy(new FileInputStream("src\\main\\resources\\a.txt"), Paths.get("src\\main\\resources\\b.txt"), StandardCopyOption.REPLACE_EXISTING);
        BufferedReader reader = new BufferedReader(new FileReader("src\\main\\resources\\a.txt"));
        String re;
        while ((re = reader.readLine()) != null) {
            list.add(re);
        }
        for (String s : list) {
            System.out.println(s);
        }
    }
}
